#ifndef Bezier_HPP
#define Bezier_HPP
#include "Function.hpp"
#include <vector>

class Bezier {
public:
    Bezier(const std::vector<double>& xData, const std::vector<double>& yData,
           const std::vector<double>& PxData, const std::vector<double>& PyData);

    std::vector<double> operator()(double t) const; // 计算函数值

private:
    std::vector<std::vector<std::vector<double>>> controlPoints;// 存储所有控制点的坐标
    static double BernsteinPolynomial(int n, int k, double t);
};



#endif